package ua.com.globallogic.basecamp.krasnyanskiy.anagrams;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringParser {
    List<String> parse(String s){
        List<String> words = new ArrayList<String>();
        Pattern p = Pattern.compile("\\b[A-Za-z[-]а-яА-Я]+\\b");
        Matcher m = p.matcher(s);
        while (m.find()) {
            words.add(m.group().toLowerCase());
        }
        return words;
    }
}
